<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateEnderecoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateEnderecoLabel_idEndereco}" for="idEndereco" />
                    <h:inputText id="idEndereco" value="#{enderecoController.selected.idEndereco}" title="#{bundle.CreateEnderecoTitle_idEndereco}" required="true" requiredMessage="#{bundle.CreateEnderecoRequiredMessage_idEndereco}"/>
                    <h:outputLabel value="#{bundle.CreateEnderecoLabel_descricao}" for="descricao" />
                    <h:inputText id="descricao" value="#{enderecoController.selected.descricao}" title="#{bundle.CreateEnderecoTitle_descricao}" required="true" requiredMessage="#{bundle.CreateEnderecoRequiredMessage_descricao}"/>
                    <h:outputLabel value="#{bundle.CreateEnderecoLabel_bairro}" for="bairro" />
                    <h:inputText id="bairro" value="#{enderecoController.selected.bairro}" title="#{bundle.CreateEnderecoTitle_bairro}" required="true" requiredMessage="#{bundle.CreateEnderecoRequiredMessage_bairro}"/>
                    <h:outputLabel value="#{bundle.CreateEnderecoLabel_complemento}" for="complemento" />
                    <h:inputText id="complemento" value="#{enderecoController.selected.complemento}" title="#{bundle.CreateEnderecoTitle_complemento}" required="true" requiredMessage="#{bundle.CreateEnderecoRequiredMessage_complemento}"/>
                    <h:outputLabel value="#{bundle.CreateEnderecoLabel_tipoEndereco}" for="tipoEndereco" />
                    <h:selectOneMenu id="tipoEndereco" value="#{enderecoController.selected.tipoEndereco}" title="#{bundle.CreateEnderecoTitle_tipoEndereco}" required="true" requiredMessage="#{bundle.CreateEnderecoRequiredMessage_tipoEndereco}">
                        <f:selectItems value="#{tipoenderecoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateEnderecoLabel_pessoa}" for="pessoa" />
                    <h:selectOneMenu id="pessoa" value="#{enderecoController.selected.pessoa}" title="#{bundle.CreateEnderecoTitle_pessoa}" required="true" requiredMessage="#{bundle.CreateEnderecoRequiredMessage_pessoa}">
                        <f:selectItems value="#{pessoaController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateEnderecoLabel_cidade}" for="cidade" />
                    <h:selectOneMenu id="cidade" value="#{enderecoController.selected.cidade}" title="#{bundle.CreateEnderecoTitle_cidade}" required="true" requiredMessage="#{bundle.CreateEnderecoRequiredMessage_cidade}">
                        <f:selectItems value="#{cidadeController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{enderecoController.create}" value="#{bundle.CreateEnderecoSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{enderecoController.prepareList}" value="#{bundle.CreateEnderecoShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateEnderecoIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
